/*************************************************************
 * File: Customer.java
 * Copyright (c) 2012
 * Author: Huang Shaobin
 * Email: Shaobin.Software@gmail.com Shaobin_Software@163.com 
 * Date: Feb 26, 2013
 * Description: 
 ************************************************************/

package snow.biz.selling.model;

import snow.biz.basic.model.Persistence;
import snow.biz.system.model.User;
import snow.core.enums.Status;
import snow.core.exceptions.BusinessException;
import snow.core.toolkit.Validator;

/**
 * 客户实体
 * 
 * @author Shaobin.Software@gmail.com Shaobin_Software@163.com
 * @version 1.0
 */
@SuppressWarnings("serial")
public class Customer extends Persistence<Integer> {

	private String code; // 客户代码
	private String name; // 客户名称
	private String alias; // 客户别称
	private String comment; // 客户描述
	private User owner; // 客户所属人

	protected Customer() {
	}

	public Customer(User createUser, Status status, String code, String name, String alias, String comment, User owner) throws BusinessException {
		super(createUser, status);
		Validator.notBlank(code, "", "");
		this.code = code.trim();
		setName(name);
		setAlias(alias);
		setComment(comment);
		setOwner(owner);
	}

	public String getAlias() {
		return this.alias;
	}

	public String getCode() {
		return this.code;
	}

	public String getComment() {
		return this.comment;
	}

	public String getName() {
		return this.name;
	}

	public User getOwner() {
		return this.owner;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public void setCode(String code) {
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setOwner(User owner) throws BusinessException {
		Validator.notNull(owner, "", "");
		this.owner = owner;
	}

}
